//***********************************************************************
// FILE: adc.c
// AUTHOR: Yuriy Skriyka
// DATE: 27-03-2012 
// DESCRIPTION: The file contains implementation analog to digital convertor.
//************************************************************************

#include "adc.h"
#include <avr/io.h>
#include <avr/interrupt.h>

// ----------------------------------------------------------------------------
/*
void initADC(void)
{
   ADMUX |= _BV(REFS0) | _BV(ADLAR) | _BV(MUX0);      // internal voltage reference, left result adjustment
   // ADC1 as ADC input

   DIDR0 |= _BV(ADC1D);    // disable digital buffer for the analog pin

   // enable free running mode  
   // prescaler 128
   // start single conversion
   ADCSRA = _BV(ADATE) | _BV(ADPS2) | _BV(ADPS1) | _BV(ADPS0) | _BV(ADEN) | _BV(ADSC);   
}
*/
// ----------------------------------------------------------------------------
/*
uint8_t getVoltage(void)
{
   return ADCH;
}
*/
// ----------------------------------------------------------------------------